<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="theme-color" content="#2563eb">
    <title>豪华地产 - 楼盘详情</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        body {
            font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
            -webkit-tap-highlight-color: transparent;
        }
        .scrollbar-hide::-webkit-scrollbar {
            display: none;
        }
        .scrollbar-hide {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        .card-shadow {
            box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
        }
    </style>
</head>
<body class="bg-gray-50 text-gray-800">
    <!-- 楼盘详情页面 -->
    <div class="page bg-white h-full overflow-y-auto pb-24">
        <!-- 头部图片部分 -->
        <!-- 轮播图 -->
        <div class="relative h-64">
            <!-- 轮播图片 -->
            <div class="swiper-container h-full">
                <div class="absolute inset-0">
                    <img src="https://images.unsplash.com/photo-1560185007-cde436f6a4d0" alt="楼盘图片" class="w-full h-full object-cover">
                </div>
            </div>
            <!-- 返回按钮 -->
            <a href="property-list.html" class="absolute top-4 left-4 bg-black/30 rounded-full p-2 text-white">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
                </svg>
            </a>
            <!-- 分享和收藏按钮 -->
            <div class="absolute top-4 right-4 flex space-x-3">
                <button class="bg-black/30 rounded-full p-2 text-white">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" />
                    </svg>
                </button>
                <button class="bg-black/30 rounded-full p-2 text-white">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
                    </svg>
                </button>
            </div>
            <!-- 指示器 -->
            <div class="absolute bottom-4 left-0 right-0 flex justify-center space-x-2">
                <div class="w-2 h-2 rounded-full bg-white"></div>
                <div class="w-2 h-2 rounded-full bg-white/50"></div>
                <div class="w-2 h-2 rounded-full bg-white/50"></div>
            </div>
        </div>
        
        <!-- 楼盘基本信息 -->
        <div class="px-4 py-4">
            <div class="flex justify-between items-center mb-3">
                <h2 class="text-xl font-bold">¥<span class="unitPrice">32,000</span><span class="text-sm font-normal text-gray-500">/㎡起</span></h2>
                <div class="flex items-center text-blue-600 text-sm">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" />
                    </svg>
                    <span>今日特惠</span>
                </div>
            </div>
            
            <h1 class="text-lg font-bold mb-2 propertyName">御景豪庭</h1>
            
            <!-- 基本信息 -->
            <div class="flex mb-4 text-sm text-gray-500">
                <div class="mr-3 flex items-center">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" />
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" />
                    </svg>
                    <span>黄浦区·南京东路</span>
                </div>
                <div class="flex items-center">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
                    </svg>
                    <span>2023年12月交付</span>
                </div>
            </div>
            
            <!-- 标签 -->
            <div class="flex flex-wrap gap-2 mb-4">
                <span class="px-2 py-1 text-xs bg-blue-50 text-blue-600 rounded-full">精装修</span>
                <span class="px-2 py-1 text-xs bg-blue-50 text-blue-600 rounded-full">小户型</span>
                <span class="px-2 py-1 text-xs bg-blue-50 text-blue-600 rounded-full">近地铁</span>
                <span class="px-2 py-1 text-xs bg-blue-50 text-blue-600 rounded-full">学区房</span>
                <span class="px-2 py-1 text-xs bg-blue-50 text-blue-600 rounded-full">公园旁</span>
            </div>
            
            <!-- 项目介绍内容 -->
            <div class="mb-6">
                <h3 class="text-base font-medium mb-3 flex items-center">
                    <span class="w-1 h-5 bg-blue-600 rounded mr-2"></span>
                    项目介绍
                </h3>
                <div class="bg-gray-50 rounded-lg p-4 card-shadow">
                    <p class="text-sm text-gray-700 leading-relaxed mb-4">
                        御景豪庭位于黄浦区南京东路商圈核心地段，由远大地产开发，总占地面积约5万平方米，总建筑面积约15万平方米，绿化率达35%，容积率2.5，由12栋高层住宅组成。项目位置优越，交通便利，紧邻地铁2号线和8号线，10分钟直达市中心。
                    </p>
                    <p class="text-sm text-gray-700 leading-relaxed">
                        项目周边配套齐全，临近多家知名学校，包括市重点小学和二级示范高中，医疗、商业、休闲等生活配套一应俱全。建筑采用新古典主义风格，注重空间利用与美学设计的完美结合，为业主打造高品质的居住体验。
                    </p>
                </div>
            </div>
            
            <!-- 户型预览 -->
            <div class="mb-6">
                <h3 class="text-base font-medium mb-3 flex items-center">
                    <span class="w-1 h-5 bg-blue-600 rounded mr-2"></span>
                    在售户型
                </h3>
                <div class="overflow-x-auto">
                    <div class="flex space-x-3 pb-2">
                        <a href="floor-plan-detail.html" class="flex-shrink-0 w-40 border border-gray-200 rounded-lg overflow-hidden card-shadow">
                            <div class="p-3">
                                <div class="text-sm font-medium">两室一厅</div>
                                <div class="text-xs text-gray-500 mb-2">78㎡ | 南北通透</div>
                                <div class="text-xs text-blue-600">¥298万起</div>
                            </div>
                            <img src="https://images.unsplash.com/photo-1600566753190-17f0baa2a6c3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80" class="w-full h-24 object-cover" alt="户型图">
                        </a>
                        <a href="floor-plan-detail.html" class="flex-shrink-0 w-40 border border-gray-200 rounded-lg overflow-hidden card-shadow">
                            <div class="p-3">
                                <div class="text-sm font-medium">三室两厅</div>
                                <div class="text-xs text-gray-500 mb-2">106㎡ | 南北通透</div>
                                <div class="text-xs text-blue-600">¥398万起</div>
                            </div>
                            <img src="https://images.unsplash.com/photo-1600585154340-be6161a56a0c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80" class="w-full h-24 object-cover" alt="户型图">
                        </a>
                        <a href="floor-plan-detail.html" class="flex-shrink-0 w-40 border border-gray-200 rounded-lg overflow-hidden card-shadow">
                            <div class="p-3">
                                <div class="text-sm font-medium">四室两厅</div>
                                <div class="text-xs text-gray-500 mb-2">143㎡ | 南北通透</div>
                                <div class="text-xs text-blue-600">¥536万起</div>
                            </div>
                            <img src="https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80" class="w-full h-24 object-cover" alt="户型图">
                        </a>
                    </div>
                </div>
            </div>
            
            <!-- 详情信息 -->
            <div class="mb-6">
                <h3 class="text-base font-medium mb-3 flex items-center">
                    <span class="w-1 h-5 bg-blue-600 rounded mr-2"></span>
                    楼盘详情
                </h3>
                <div class="grid grid-cols-2 gap-y-3 gap-x-4 text-sm">
                    <div class="flex justify-between">
                        <span class="text-gray-500">开发商</span>
                        <span>远大地产</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">产权年限</span>
                        <span>70年</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">容积率</span>
                        <span>2.5</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">绿化率</span>
                        <span>35%</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">规划户数</span>
                        <span>1560户</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">车位比</span>
                        <span>1:1.2</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">物业公司</span>
                        <span>远大物业</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">物业费</span>
                        <span>3.8元/㎡/月</span>
                    </div>
                </div>
            </div>
            
            <!-- 周边配套 -->
            <div class="mb-6">
                <h3 class="text-base font-medium mb-3 flex items-center">
                    <span class="w-1 h-5 bg-blue-600 rounded mr-2"></span>
                    周边配套
                </h3>
                <div class="text-sm text-gray-700 leading-relaxed mb-3">
                    <p class="mb-2"><strong>教育：</strong>临近市重点小学和二级示范高中，幼儿园步行5分钟可达。</p>
                    <p class="mb-2"><strong>交通：</strong>地铁2号线、8号线双轨交汇，10分钟可达市中心。</p>
                    <p class="mb-2"><strong>商业：</strong>环绕多个大型购物中心，生活便利性极高。</p>
                    <p><strong>医疗：</strong>三甲医院步行可达，多家社区医院环绕。</p>
                </div>
            </div>
        </div>
        
        <!-- 底部固定按钮 -->
        <div class="sticky bottom-16 left-0 right-0 bg-white border-t border-gray-100 shadow-md z-10 px-4 py-3 flex justify-between">
            <button onclick="document.getElementById('mortgageModal').classList.remove('hidden')" class="flex-1 bg-blue-50 text-blue-600 rounded-full py-2 mr-2 font-medium text-sm flex items-center justify-center">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z" />
                </svg>
                房贷计算
            </button>
            <button onclick="document.getElementById('appointmentModal').classList.remove('hidden')" class="flex-1 bg-blue-600 text-white rounded-full py-2 font-medium text-sm flex items-center justify-center shadow-lg shadow-blue-600/20">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
                </svg>
                预约看房
            </button>
        </div>
    </div>

    <!-- 房贷计算模态框 -->
    <div id="mortgageModal" class="fixed inset-0 bg-black/70 z-50 hidden">
        <div class="absolute bottom-0 left-0 right-0 bg-white rounded-t-2xl max-h-[90vh] overflow-y-auto">
            <div class="sticky top-0 bg-white p-4 border-b border-gray-100 flex justify-between items-center">
                <h3 class="text-lg font-bold">房贷计算器</h3>
                <button class="close-modal p-2" onclick="this.parentElement.parentElement.parentElement.classList.add('hidden')">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
                    </svg>
                </button>
            </div>
            <div class="p-4">
                <div class="mb-4">
                    <label class="block text-sm text-gray-500 mb-1">总价</label>
                    <div class="flex items-center border border-gray-300 rounded-lg overflow-hidden">
                        <input type="number" id="totalPrice" value="300" class="flex-grow p-3 text-base outline-none">
                        <span class="px-3 text-gray-500">万元</span>
                    </div>
                </div>
                <div class="mb-4">
                    <label class="block text-sm text-gray-500 mb-1">首付比例</label>
                    <div class="grid grid-cols-3 gap-3">
                        <button class="downpayment-btn py-2 border border-gray-300 text-gray-500 rounded-lg text-sm" data-ratio="0.3">3成</button>
                        <button class="downpayment-btn py-2 bg-blue-600 text-white rounded-lg text-sm" data-ratio="0.35">3.5成</button>
                        <button class="downpayment-btn py-2 border border-gray-300 text-gray-500 rounded-lg text-sm" data-ratio="0.4">4成</button>
                    </div>
                </div>
                <div class="mb-4">
                    <label class="block text-sm text-gray-500 mb-1">贷款年限</label>
                    <div class="grid grid-cols-4 gap-3">
                        <button class="loan-year-btn py-2 border border-gray-300 text-gray-500 rounded-lg text-sm" data-year="10">10年</button>
                        <button class="loan-year-btn py-2 border border-gray-300 text-gray-500 rounded-lg text-sm" data-year="20">20年</button>
                        <button class="loan-year-btn py-2 bg-blue-600 text-white rounded-lg text-sm" data-year="30">30年</button>
                        <button class="loan-year-btn py-2 border border-gray-300 text-gray-500 rounded-lg text-sm" data-year="custom">自定义</button>
                    </div>
                </div>
                <div class="mb-4">
                    <label class="block text-sm text-gray-500 mb-1">贷款方式</label>
                    <div class="grid grid-cols-3 gap-3">
                        <button class="loan-type-btn py-2 bg-blue-600 text-white rounded-lg text-sm" data-rate="4.35">商业贷款</button>
                        <button class="loan-type-btn py-2 border border-gray-300 text-gray-500 rounded-lg text-sm" data-rate="3.25">公积金贷款</button>
                        <button class="loan-type-btn py-2 border border-gray-300 text-gray-500 rounded-lg text-sm" data-rate="3.80">组合贷款</button>
                    </div>
                </div>
                <div class="mb-4">
                    <label class="block text-sm text-gray-500 mb-1">贷款金额</label>
                    <div class="flex items-center border border-gray-300 rounded-lg overflow-hidden">
                        <input type="number" id="loanAmount" value="195" class="flex-grow p-3 text-base outline-none">
                        <span class="px-3 text-gray-500">万元</span>
                    </div>
                </div>
                <div class="mb-6">
                    <label class="block text-sm text-gray-500 mb-1">贷款利率</label>
                    <div class="flex items-center border border-gray-300 rounded-lg overflow-hidden">
                        <input type="text" id="interestRate" value="4.35" class="flex-grow p-3 text-base outline-none">
                        <span class="px-3 text-gray-500">%</span>
                    </div>
                </div>
                
                <div class="bg-gray-50 p-4 rounded-lg mb-6 card-shadow">
                    <div class="flex justify-between mb-3">
                        <span class="text-gray-500">贷款金额</span>
                        <span class="text-gray-800 font-medium" id="loanAmountDisplay">195万</span>
                    </div>
                    <div class="flex justify-between mb-3">
                        <span class="text-gray-500">每月还款</span>
                        <span class="text-blue-600 text-xl font-bold" id="monthlyPayment">9,698元</span>
                    </div>
                    <div class="flex justify-between">
                        <span class="text-gray-500">支付利息</span>
                        <span class="text-gray-800 font-medium" id="totalInterest">154.1万</span>
                    </div>
                </div>
                
                <button class="w-full bg-blue-600 text-white rounded-full py-3 font-medium shadow-lg shadow-blue-600/20">
                    完整还款计划
                </button>
            </div>
        </div>
    </div>
    
    <!-- 预约看房模态框 -->
    <div id="appointmentModal" class="fixed inset-0 bg-black/70 z-50 hidden">
        <div class="absolute bottom-0 left-0 right-0 bg-white rounded-t-2xl">
            <div class="p-4 border-b border-gray-100 flex justify-between items-center">
                <h3 class="text-lg font-bold">预约看房</h3>
                <button class="close-modal p-2" onclick="this.parentElement.parentElement.parentElement.classList.add('hidden')">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
                    </svg>
                </button>
            </div>
            <div class="p-4">
                <div class="mb-4">
                    <label class="block text-sm text-gray-500 mb-1">您的姓名</label>
                    <input type="text" placeholder="请输入您的姓名" class="w-full p-3 border border-gray-300 rounded-lg outline-none focus:border-blue-600">
                </div>
                <div class="mb-4">
                    <label class="block text-sm text-gray-500 mb-1">联系电话</label>
                    <input type="tel" placeholder="请输入您的手机号" class="w-full p-3 border border-gray-300 rounded-lg outline-none focus:border-blue-600">
                </div>
                <div class="mb-4">
                    <label class="block text-sm text-gray-500 mb-1">看房时间</label>
                    <div class="grid grid-cols-3 gap-3 mb-3">
                        <button class="py-2 border border-blue-600 text-blue-600 rounded-lg text-sm">今天</button>
                        <button class="py-2 bg-blue-600 text-white rounded-lg text-sm">明天</button>
                        <button class="py-2 border border-gray-300 text-gray-500 rounded-lg text-sm">后天</button>
                    </div>
                    <div class="grid grid-cols-4 gap-3">
                        <button class="py-2 border border-gray-300 text-gray-500 rounded-lg text-sm">上午</button>
                        <button class="py-2 bg-blue-600 text-white rounded-lg text-sm">下午</button>
                        <button class="py-2 border border-gray-300 text-gray-500 rounded-lg text-sm">晚上</button>
                        <button class="py-2 border border-gray-300 text-gray-500 rounded-lg text-sm">待定</button>
                    </div>
                </div>
                <div class="mb-6">
                    <label class="block text-sm text-gray-500 mb-1">看房意向</label>
                    <div class="grid grid-cols-3 gap-3">
                        <button class="py-2 border border-gray-300 text-gray-500 rounded-lg text-sm">刚需</button>
                        <button class="py-2 bg-blue-600 text-white rounded-lg text-sm">改善</button>
                        <button class="py-2 border border-gray-300 text-gray-500 rounded-lg text-sm">投资</button>
                    </div>
                </div>
                
                <button class="w-full bg-blue-600 text-white rounded-full py-3 font-medium shadow-lg shadow-blue-600/20">
                    确认预约
                </button>
                <div class="text-xs text-center text-gray-400 mt-3">
                    预约成功后，置业顾问会尽快联系您
                </div>
            </div>
        </div>
    </div>

    <!-- 底部导航 -->
    <div class="fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 z-20">
        <div class="grid grid-cols-5 h-16">
            <a href="index.html" class="flex flex-col items-center justify-center text-gray-400">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7m-7-7v14" />
                </svg>
                <span class="text-xs mt-1">首页</span>
            </a>
            <a href="property-list.html" class="flex flex-col items-center justify-center text-blue-600">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
                </svg>
                <span class="text-xs mt-1">楼盘列表</span>
            </a>
            <a href="floor-plan-list.html" class="flex flex-col items-center justify-center text-gray-400">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" />
                </svg>
                <span class="text-xs mt-1">户型列表</span>
            </a>
            <a href="appointment.html" class="flex flex-col items-center justify-center text-gray-400">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
                </svg>
                <span class="text-xs mt-1">预约看房</span>
            </a>
            <a href="my.html" class="flex flex-col items-center justify-center text-gray-400">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
                </svg>
                <span class="text-xs mt-1">我的</span>
            </a>
        </div>
    </div>

    <script>
        // 关闭模态框
        document.querySelectorAll('.close-modal').forEach(btn => {
            btn.addEventListener('click', function() {
                document.querySelectorAll('.modal').forEach(modal => {
                    modal.classList.add('hidden');
                });
            });
        });

        // 房贷计算器变量
        let totalPrice = 300; // 总价 (万元)
        let downpaymentRatio = 0.35; // 首付比例 (默认3.5成)
        let loanYears = 30; // 贷款年限 (默认30年)
        let interestRate = 4.35; // 贷款利率 (默认4.35%)
        
        // 首付按钮
        document.querySelectorAll('.downpayment-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                // 移除其他按钮的选中状态
                document.querySelectorAll('.downpayment-btn').forEach(b => {
                    b.classList.remove('bg-blue-600', 'text-white');
                    b.classList.add('border-gray-300', 'text-gray-500');
                });
                
                // 添加选中状态
                this.classList.remove('border-gray-300', 'text-gray-500');
                this.classList.add('bg-blue-600', 'text-white');
                
                // 更新首付比例
                downpaymentRatio = parseFloat(this.getAttribute('data-ratio'));
                updateCalculation();
            });
        });
        
        // 贷款年限按钮
        document.querySelectorAll('.loan-year-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                // 移除其他按钮的选中状态
                document.querySelectorAll('.loan-year-btn').forEach(b => {
                    b.classList.remove('bg-blue-600', 'text-white');
                    b.classList.add('border-gray-300', 'text-gray-500');
                });
                
                // 添加选中状态
                this.classList.remove('border-gray-300', 'text-gray-500');
                this.classList.add('bg-blue-600', 'text-white');
                
                // 更新贷款年限
                const year = this.getAttribute('data-year');
                if (year !== 'custom') {
                    loanYears = parseInt(year);
                    updateCalculation();
                } else {
                    // 自定义年限逻辑，可以添加弹窗或其他输入方式
                    const customYear = prompt('请输入贷款年限 (1-30年):', loanYears);
                    if (customYear !== null && !isNaN(customYear) && customYear > 0 && customYear <= 30) {
                        loanYears = parseInt(customYear);
                        updateCalculation();
                    }
                }
            });
        });
        
        // 贷款方式按钮
        document.querySelectorAll('.loan-type-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                // 移除其他按钮的选中状态
                document.querySelectorAll('.loan-type-btn').forEach(b => {
                    b.classList.remove('bg-blue-600', 'text-white');
                    b.classList.add('border-gray-300', 'text-gray-500');
                });
                
                // 添加选中状态
                this.classList.remove('border-gray-300', 'text-gray-500');
                this.classList.add('bg-blue-600', 'text-white');
                
                // 更新贷款利率
                interestRate = parseFloat(this.getAttribute('data-rate'));
                document.getElementById('interestRate').value = interestRate;
                updateCalculation();
            });
        });
        
        // 监听总价输入
        document.getElementById('totalPrice').addEventListener('input', function() {
            totalPrice = parseFloat(this.value) || 0;
            updateCalculation();
        });
        
        // 监听贷款金额输入
        document.getElementById('loanAmount').addEventListener('input', function() {
            // 直接使用用户输入的贷款金额，不根据首付比例计算
            updateCalculation();
        });
        
        // 监听利率输入
        document.getElementById('interestRate').addEventListener('input', function() {
            interestRate = parseFloat(this.value) || 0;
            updateCalculation();
        });
        
        // 更新计算结果
        function updateCalculation() {
            // 计算贷款金额 (如果用户没有手动修改)
            const loanInput = document.getElementById('loanAmount');
            const calculatedLoanAmount = (totalPrice * (1 - downpaymentRatio)).toFixed(2);
            
            // 只有当用户没有手动修改时，才自动更新贷款金额
            if (!loanInput.dataset.userModified) {
                loanInput.value = calculatedLoanAmount;
            }
            
            // 获取当前贷款金额
            const loanAmount = parseFloat(loanInput.value) || 0;
            
            // 更新显示的贷款金额
            document.getElementById('loanAmountDisplay').textContent = loanAmount.toFixed(2) + '万';
            
            // 计算月供
            const monthlyRate = interestRate / 100 / 12;
            const numberOfPayments = loanYears * 12;
            const monthlyPayment = (loanAmount * 10000 * monthlyRate) / (1 - Math.pow(1 + monthlyRate, -numberOfPayments));
            
            // 计算总利息
            const totalPayment = monthlyPayment * numberOfPayments;
            const totalInterest = totalPayment - loanAmount * 10000;
            
            // 更新界面
            document.getElementById('monthlyPayment').textContent = monthlyPayment.toFixed(2) + '元';
            document.getElementById('totalInterest').textContent = (totalInterest / 10000).toFixed(2) + '万';
        }
        
        // 标记用户是否手动修改了贷款金额
        document.getElementById('loanAmount').addEventListener('focus', function() {
            this.dataset.userModified = true;
        });
        
        // 初始计算
        updateCalculation();
    </script>
</body>
</html>